﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HenIT.BizTalk.Objects
{
    public class TransportInfo
    {
        public TransportInfo()
        {
            IsUsed = new BoolMatch(false);
            TransportType = new StringMatch("N/A");
            SendHandler = new StringMatch("N/A");
            SendHandlerHost = new StringMatch("N/A");
            RetryCount = new IntMatch(0);
            RetryInterval = new IntMatch(0);
            ServiceWindowEnabled = new BoolMatch(false);
            FromTime = new DateTimeMatch(DateTime.Now);
            ToTime = new DateTimeMatch(DateTime.Now);
        }

        public bool Match { get; set; }
        public BoolMatch IsUsed { get; set; }

        public StringMatch TransportType { get; set; }
        public StringMatch SendHandler { get; set; }
        public StringMatch SendHandlerHost { get; set; }
        public IntMatch RetryCount { get; set; }
        public IntMatch RetryInterval { get; set; }
        public BoolMatch ServiceWindowEnabled { get; set; }
        public DateTimeMatch FromTime { get; set; }
        public DateTimeMatch ToTime { get; set; }

        public void MatchPropertiesWith(TransportInfo ti2)
        {
            Match = (IsUsed.Value == ti2.IsUsed.Value);
            IsUsed.Value2 = ti2.IsUsed.Value;
            TransportType.Name2 = ti2.TransportType.Name;
            SendHandler.Name2 = ti2.SendHandler.Name;
            SendHandlerHost.Name2 = ti2.SendHandlerHost.Name;
            RetryCount.Value2 = ti2.RetryCount.Value;
            RetryInterval.Value2 = ti2.RetryInterval.Value;
            ServiceWindowEnabled.Value2 = ti2.ServiceWindowEnabled.Value;
            FromTime.Value2 = ti2.FromTime.Value;
            ToTime.Value2 = ti2.ToTime.Value;
        }

        //public DateTime FromTime { get; set; }
        //public bool OrderedDelivery { get; set; }
        //public bool Primary { get; }
        //public int RetryCount { get; set; }
        //public int RetryInterval { get; set; }
        //public SendHandler SendHandler { get; set; }
        //public SendPort SendPort { get; }
        //public bool ServiceWindowEnabled { get; set; }
        //public DateTime ToTime { get; set; }
        //public ProtocolType TransportType { get; set; }
        //public string TransportTypeData { get; set; }
    }
}
